<template>
	<view class="container">
		<view class="bg">
			<view class="navtitle">
				<view class="left" @click="back"></view>
				<view class="title">
					团购优惠
				</view>
			</view>
		</view>
		<view class="card">
			<uni-card style="border-radius: 30rpx;">
				<view class="ctitle">
					{{groupPurchase.title}}
				</view>
				<view class="subtitle">
					<view class="tleft">
						{{groupPurchase.publisher}}
					</view>
					<view class="tright">
						{{groupPurchase.time}}
					</view>
				</view>
				<view class="img">
					<image :src="groupPurchase.img"></image>
				</view>
				<view class="introduce">
					<span>{{groupPurchase.content}}</span>
				</view>
			</uni-card>
		</view>
		<view class="card2">
			<uni-card style="border-radius: 20rpx;">
				<view class="price">
					<view class="price1">
						价格：￥{{groupPurchase.originalPrice}}
					</view>
					<view class="price2">
						原价：￥{{groupPurchase.presentPrice}}
					</view>
				</view>
				<view class="time">活动截止日期：{{groupPurchase.endTime}}</view>
				<view class="phone">
					咨询电话：0379-66666666
				</view>
				<view class="warn">
					注意事项：{{groupPurchase.note}}
				</view>
			</uni-card>
		</view>
	</view>
</template>

<script>
	import request from '../../../uitls/request';
	export default {
		data() {
			return {
				groupPurchase:{}
			}
		},
		onLoad(options) {
			console.log(options,"恶趣味任务")
			if(options.id){
			this.enterGroupDetail(options.id);
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			enterGroupDetail(id){
				request({
					url:`/offer/purchase/${id}`,
					method:'GET',
					success:(res)=>{
						if(res.data.code === 200){
							this.groupPurchase = res.data.data;
						}
						console.log(this.groupPurchase.title);
					}
				})
			}
		}
	}
		
</script>

<style scoped>
	.bg {
		width: 100%;
		height: 360rpx;
		background-color: #3082fb;
		overflow: hidden;
	}

	.navtitle {
		display: flex;
		margin-top: 40rpx;
		/* border: 1px solid red; */
		align-items: center;
	}

	.navtitle .left {
		width: 28rpx;
		height: 28rpx;
		margin-left: 20rpx;
		border-left: 2px solid white;
		border-bottom: 2px solid white;
		transform: rotate(45deg);
	}

	.bg .title {
		color: #e0ebfd;
		font-size: 40rpx;
		margin-left: 260rpx;
		font-family: 'Times New Roman', Times, serif;
		font-weight: 600;
	}
	.card{
		margin-top: -210rpx;
	}
	.card .ctitle {
		text-align: center;
		font-size: 30rpx;
		font-weight: bold;
	}

	.card .subtitle {
		margin-top: 10rpx;
		display: flex;
		justify-content: space-between;
		font-size: 22rpx;
		color: #b8b8b8;
	}

	.img image {
		height: 460rpx;
		border-radius: 24rpx;
		margin-top: 20rpx;
	}

	.introduce {
		text-indent: 2em;
	}
	.card2 .price{
		display: flex;
	}
	.price1{
		color: #ff5926;
		font-size: 36rpx;
	}
	.price2{
		margin-left: 50rpx;
		font-size: 22rpx;
		text-decoration-line: line-through;
	}
	.time{
		margin-top: 10rpx;
		font-size: 26rpx;
		font-weight: 600;
	}
	.phone{
		margin-top: 10rpx;
		font-weight: 600;
	}
	.warn{
		margin-top: 10rpx;
		font-weight: 600;
	}
</style>